package demo.controller;

import demo.entity.User;
import demo.rpc.DemoService;
import demo.service.UserService;
import jk.fox.annotaion.RpcReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author cuichao
 * @Description: DemoController
 * @Date: create in 2020/6/2 21:09
 */
@RestController
public class DemoController {

    @Autowired
    private UserService userService;

    @RpcReference
    private DemoService demoService;

    @RequestMapping("rpc")
    public User rpcDemo(String id){
        return userService.getUser(id);
    }


    @RequestMapping("rpc1")
    public User rpcDemo1(String id){
        return userService.getUser(id);
    }



}
